<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt"  prefix="fmt"%>
<%@ include file="/WEB-INF/jsp/tag.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>修改用户信息</title>

</head>
<LINK rel="stylesheet" type="text/css" href="${baseurl}js/easyui/styles/default.css">
<%@ include file="/WEB-INF/jsp/common_css.jsp"%>
<%@ include file="/WEB-INF/jsp/common_js.jsp"%>
<body> 
<form id="itemForm" action="${baseurl }user/updateUser.action" method="post" >
修改用户信息：
<table width="100%" border=1>
<input type="hidden" value="${activeUser.usercode}" id="usercode">
<tr>
	<td>原密码</td>
	<td><input type="text" name="previousPassword" id="previousPassword" "/></td>
</tr>
<tr>
	<td>新密码</td>
	<td><input type="text" name="passwordnew1" id="passwordnew1" /></td>
</tr>
<tr>
	<td>密码确认</td>
	<td><input type="text" name="passwordnew2" id="passwordnew2" /></td>
</tr>

<tr>
<td colspan="2" align="center"><input type="button" value="提交 " id="btn_submit" />
</td>
</tr>
</table>

</form>
</body>
<script type="text/javascript">

	/* 
	function loginsubmit() {
		$("#itemForm").submit();

	} */
	
	$("#btn_submit").click( function() {  
        var url = '${baseurl }user/updateUser.action';  
        //获取表单值，并以json的数据形式保存到params中  
        var params = {  
        		previousPassword:$("#previousPassword").val(),  
        		passwordnew1:$("#passwordnew1").val(),
        		passwordnew2:$("#passwordnew2").val(),
        		usercode:$("#usercode").val()
        }  
        //使用$.post方式  
        console.info("post之前");   
        $.post(  
            url,        //服务器要接受的url  
            params,     //传递的参数  
            function(data){ 
            	//服务器返回后执行的函数 参数 data保存的就是服务器发送到客户端的数据  
            	if(data.resultMsg=='更新成功'){  
                   // window.location.href = 'http://localhost:8081/electroniceBank/first.action';  
            		
                        window.parent.location.reload(true);  
            	}  
                else {  
                    alert(data.resultMsg);  
                }  
                  
                console.info("cbf执行中");           
            },   
            "json"  //数据传递的类型  json  
        );  
    });  
	 
	
</SCRIPT>
</html>